package com.yzf.demo.demo.array;

import java.lang.reflect.Array;

/**
 * Created by 于占峰 on 2020/3/26/026.
 */
public class ArrayDemoBean {

    public static void main(String[] args) {
        //声明数组
        //String数组
        String[] strs = new String[5];
        String[] strs1 = new String[]{"1", "2", "a", "b"};
        String[] strs2 = {"1", "2", "a", "b"};
        //int数组
        int[] ints = new int[5];
        int[] ints1 = new int[]{1, 2, 3, 4, 5};
        int[] ints2 = {1, 2, 3, 4, 5};
        //输出
        System.out.println(ints);
        System.out.println(ints1[0]);
        //遍历
        for (int i = 0; i < ints2.length; i++) {
            System.out.print(ints2[i]);
        }
        System.out.println("\n");
        //赋值
        ints2[2] = 10;
        for (int i = 0; i < ints2.length; i++) {
            System.out.print(ints2[i]);
        }

    }
}
